<?php
include($_SERVER['DOCUMENT_ROOT']."/inc/Function_index.php");
$catlist = catelist();
$list2 = goodslist(1,20,0,2,1);
$list3 = goodslist(1,20,0,3,1);
$ilist = infolist(1,4);
$lunbo = lunbo(0);
$lunbo1 = lunbo(1);
$u = false;
$cat2= menu(2);
$cat3= menu(3);
$taglist1 = taglist(1);
$taglist2 = taglist(2);

// 为每个一级分类加载该分类下的商品
$taglist1_goods = array();
if($taglist1){
	for($i=0; $i<count($taglist1); $i++){
		// 为每个分类加载商品，并存储在独立的数组中
		$tag_id = $taglist1[$i]['Id'];
		$taglist1_goods[$tag_id] = goodslist(1,5,0,0,1,$tag_id,0,'',0);
	}
}

$tpl->assign("u",$u);
$tpl->assign("cat2",$cat2);
$tpl->assign("cat3",$cat3);
$tpl->assign("taglist1",$taglist1);
$tpl->assign("taglist2",$taglist2);
$tpl->assign("taglist1_goods",$taglist1_goods);
$tpl->assign("lunbo",$lunbo);
$tpl->assign("lunbo1",$lunbo1);
$tpl->assign("cat",$catlist);
$tpl->assign("list2",$list2);
$tpl->assign("list3",$list3);
$tpl->assign("ilist",$ilist);
$tpl->assign('catarr',$catarr);
$tpl->assign('results',$results);
$tpl->show("index");
?>